{% extends "base.html" %}
{% block meta_block %}
{%if post.tagNames%}<meta name="Keywords" content="{{post.tagNames}}" />{%endif%}
{%if post.excerpt%} <meta name="Description" content="{{post.excerpt}}" />{%endif%}
{% endblock %}
{% block title %} {{post.title}} - {{site.title}} {% endblock %}
{% block head_block %}
<script type="text/javascript" src="{{site.url}}themes/{{site.theme}}/style/jquery.min.js"></script>
<script type="text/javascript" src="{{site.url}}themes/{{site.theme}}/style/jquery.form.js"></script>
{% endblock %}
{% block content %}
<div id="left-content-single">

<div class="post-home">
	<div id="post-title-single">
		<h1><a href="{{post.link}}" rel="bookmark" title="永久链接到{{post.title}}">{{post.title}}</a></h1>
	</div>
	<div class="post-content">
		<div id="post-messages-single">
			<span class="post-msg">{% if post.tagNames %}Tags: {%for tag in post.tags%}<a href="{{site.url}}tag/{{tag.slogan}}.html">{{tag.name}}</a> {%endfor%}{%endif%}  Posted in {%for cate in post.categories%} <a href="{{site.url}}category/{{cate.slogan}}.html">{{cate.name}}</a> {%endfor%}  {%if self.is_admin%}<a href="{{site.url}}jva.log?a=Post&d=edit&id={{post.id}}">Edit</a>  {%endif%} </span><span class="post-comment">:-)<a href="#comment" >说点什么吧</a></span>
		</div>
		{# <div class="ad280">
			 <script type="text/javascript">
				google_ad_client = "pub-6795548912714843";
				google_ad_slot = "8320640581";
				google_ad_width = 250;
				google_ad_height = 250;
			</script>
			<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> 
		</div> #}
		{{ post.article }}
		{% if post.source %}
		<p>&nbsp;</p><div>内容来源： <a href="{{post.source}}">{{post.source}}</a></div>	
		{% endif %}
		<div class="post-time">{{post.date|date:"HH:mm yyyy-MM-dd"}}</div>
	</div>
	{%if relateposts%}
    <div id="relate-post">
		<h3>Relate Posts:<span>// 相关文章</span></h3>
            <ul>
            {%for post in relateposts%}
                <li><a href="{{post.link}}">{{post.title}}<span>{{post.date|date:"HH:mm yyyy-MM-dd"}}</span></a></li>
            {%endfor%}
            </ul>
	</div>
    {%endif%}
</div>    
<div id="post-messages-single">
<div style="float:right;height:10px">
{%if post.next%}
<a href="{{next.link}}">{{next.title}}»</a>
{%endif%}
</div>
<div style="float:left">
{%if post.prev%}
<a href="{{prev.link}}">«{{prev.title}}</a>
{%endif%}
</div>
</div>

<div id="comment">
{% include "comments.html" %}
</div>

</div>

{% include "sidebar.html" %}
{% endblock %}
{%block script %}
<script type="text/javascript">
	$(function() { 
	    var options = {
	    	    dataType: 'json',
	    	    success : function(data) {
		    			var hmd = $("#hiddenMessage");
		    			if (data.type == "error") {
		    				hmd.html("<div class='error'>" + data.message + "</div>");
		    			} else {
		    				hmd.html("<div class='info'>" + data.message + "</div>");
		    				$("#submit").hide();
		    			}
		    			hmd.show();
	    			},
	    	};
	    	$("#commentForm").ajaxForm(options);
	    }
	);
</script>
{%endblock%}